package service.impl;

import com.alibaba.fastjson.JSON;
import dao.MenuDao;
import dao.impl.MenuDaoImpl;
import pojo.menu;
import service.MenuService;
import utils.BeansFactory;

import java.util.List;

public class MenuServiceImpl implements MenuService {
    private MenuDao menuDao = (MenuDao) BeansFactory.getBeans("menuDao");

    @Override
    public String findAllMenu() {
//        MenuDaoImpl menuDao = new MenuDaoImpl();
        List<menu> menuList = menuDao.findAllMenuList();
        String json = JSON.toJSONString(menuList);
        return json;
    }
}
